home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / memory / emsaw41s.zip / TEST2C.C < prev    next >
Text File  |  1994-06-26  |  2KB  |  90 lines

  1. /* test2c.c */
  2. #include <type400.c>
  3. #include <c:\tc\include\stdio.h>
  4. #include <c:\tc\include\math.h>
  5.  
  6. void main()
  7. {
  8. int A, B, C, D, two, ten, sixfo, theto, ival2, four, fivei;
  9. unsigned int arin64[32], arout64[32];
  10. long totsiz, avsiz, te, hun, fivto,maxdim[5], actelem[5];
  11. float rval1, rval2;
  12. long double ththe, eval2;
  13.  
  14.  
  15.       EMINIT();
  16.  
  17.       two=2;
  18.       SIZA (&totsiz, &avsiz, &two);
  19.       printf ("%7ld       %7ld\n",totsiz,avsiz);
  20.       fivto=50000;
  21.       NEWA (&A, &fivto, &two);
  22.       theto=30000;
  23.       SETEL (&A, &fivto, &theto);
  24.       GETEL (&A, &fivto, &ival2);
  25.       printf ("%7d      %7d\n",theto, ival2);
  26.       printf("end 2 by int\n");
  27.       printf("\n");
  28.       getchar();
  29.       FREEA(&A);
  30.  
  31.       ten=10;
  32.       SIZA (&totsiz, &avsiz, &ten);
  33.       printf ("%7ld      %7ld\n",totsiz,avsiz);
  34.       hun=100;
  35.       NEWA2  (&B, &hun, &hun, (int*)&ten);
  36.       ththe=30000.0;
  37.       SETEL2 (&B, &hun, &hun, (long*)&ththe);
  38.       GETEL2 (&B, &hun, &hun, (long*)&eval2);
  39.       printf ("%e      %e\n",(double)ththe, (double)eval2);
  40.       printf ("end 10 by real\n");
  41.       printf ("\n");
  42.       getchar();
  43.       FREEA(&B);
  44.  
  45.       /* The rest of the program can be executed with full version of the
  46.       package*/
  47.       /*
  48.       SIZA (&totsiz, &avsiz, &sixfo);
  49.       printf ("%7ld      %7ld\n",totsiz,avsiz);
  50.       te=10;
  51.       sixfo=64;
  52.       NEWA3 (&C, &te, &te, &te, (int*)&sixfo);
  53.       arin64[1]=30000;
  54.       SETEL3 (&C, &te, &te, &te, (long*)&arin64[0]);
  55.       GETEL3 (&C, &te, &te, &te, (long*)&arout64[0]);
  56.       printf ("%7d      %7d\n",arin64[1], arout64[1]);
  57.       printf("end 3-D 64 by int array\n");
  58.       printf("\n");
  59.       getchar();
  60.       FREEA(&C);
  61.  
  62.  
  63.       four=4;
  64.       SIZA(&totsiz,&avsiz,(int*)&four);
  65.       printf ("%7ld      %7ld\n",totsiz,avsiz);
  66.       maxdim[0]=40;
  67.       maxdim[1]=10;
  68.       maxdim[2]=10;
  69.       maxdim[3]=10;
  70.       maxdim[4]=10;
  71.       fivei=5;
  72.       NEWAN(&D,&maxdim[0],&fivei,(int*)&four);
  73.       rval1=30000.0;
  74.       actelem[0]=40;
  75.       actelem[1]=10;
  76.       actelem[2]=10;
  77.       actelem[3]=10;
  78.       actelem[4]=10;
  79.       SETELN(&D,&actelem[0], (long int*)&rval1);
  80.       GETELN(&D,&actelem[0], (long int*)&rval2);
  81.       printf ("%7e       %7e\n",rval1, rval2);
  82.       printf("end 5-D 4 by real\n");
  83.       printf("\n");
  84.       getchar();
  85.       FREEA(&D);
  86.       */
  87. }
  88.  
  89.  
  90.